@import '_variables';

.navbar {
  background: rgba(255,255,255,0);
  transition: all .7s cubic-bezier(0, 0, 0.37, 0.94);
  //transition: transform 0.5s linear, opacity 0.5s linear;
  opacity: 0;
  --navbar-line-height: calc(
    var(--navbar-height) - 2 * var(--navbar-padding-v)
  );

  padding: var(--navbar-padding-v) var(--navbar-padding-h);
  line-height: var(--navbar-line-height);

  .logo {
    height: var(--navbar-line-height);
    width: var(--navbar-line-height);
    min-width: var(--navbar-line-height);
    margin-right: var(--navbar-padding-v);
    vertical-align: top;
  }

  .site-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--c-text);
    position: relative;
  }

  .navbar-links-wrapper {
    display: flex;
    position: absolute;
    box-sizing: border-box;
    top: var(--navbar-padding-v);
    right: var(--navbar-padding-h);
    height: var(--navbar-line-height);
    padding-left: var(--navbar-padding-h);
    white-space: nowrap;
    font-size: 0.9rem;

    .search-box {
      flex: 0 0 auto;
      vertical-align: top;
    }
  }
}

.header-bg-show:hover {
  background: rgba(255,255,255,.61);
}

.header-bg-show {
  opacity: 1;
}

@media (max-width: $MQMobile) {
  .navbar {
    padding-left: 4rem;

    .can-hide {
      display: none;
    }

    .site-name {
      width: calc(100vw - 9.4rem);
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }
}

/**
 * navbar-links
 */
.navbar-links {
  display: inline-block;

  a {
    display: inline-block;
    line-height: 1.4rem;
    color: inherit;

    &:hover,
    &.router-link-active {
      color: var(--c-text-accent);
    }
  }

  .navbar-links-item {
    position: relative;
    display: inline-block;
    margin-left: 0.65rem;
    margin-right: 0.65rem;
    line-height: var(--navbar-line-height);

    &:first-child {
      margin-left: 0;
    }
  }
}

@media (max-width: $MQMobile) {
  .navbar-links {
    .navbar-links-item {
      margin-left: 0;
    }
  }
}

@media (min-width: $MQMobile) {
  .navbar-links a {
    &:hover,
    &.router-link-active {
      color: var(--c-text);
    }
  }

  .navbar-links-item > a:not(.external) {
    &:hover,
    &.router-link-active {
      margin-bottom: -2px;
      //color: var(--auroraActiveColor);
      //border-bottom: 2px solid var(--c-text-accent);
    }
  }
}

/**
 * toggle sidebar button
 */
.toggle-sidebar-button {
  position: absolute;
  top: 0.6rem;
  left: 1rem;
  display: none;
  padding: 0.6rem;
  cursor: pointer;
}

.toggle-sidebar-button .icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

@media screen and (max-width: $MQMobile) {
  .toggle-sidebar-button {
    display: block;
  }
}

/**
 * toggle dark button
 */
.toggle-dark-button {
  display: flex;
  margin: auto;
  margin-left: 1rem;
  border: 0;
  background: none;
  color: var(--c-text);
  opacity: 0.8;
  cursor: pointer;
  &:hover {
    opacity: 1;
  }
  .icon {
    width: 1.25rem;
    height: 1.25rem;
  }
}
